Training Feedback Automation

工作流概述

这是一个包含16个节点的复杂工作流,主要用于自动化处理各种任务。

工作流源代码

下载
{
  "id": "pDLtBJkNSXXWSvB0",
  "meta": {
    "instanceId": "bc5ae5fe2056690823360ec27da902117e87ff22a0f9c9bb0448416fba4527f8"
  },
  "name": "Training Feedback Automation",
  "tags": [],
  "nodes": [
    {
      "id": "6cdd7521-a16c-4e1a-9b18-c232660522c8",
      "name": "Airtable Trigger",
      "type": "n8n-nodes-base.airtableTrigger",
      "position": [
        160,
        680
      ],
      "parameters": {
        "baseId": {
          "__rl": true,
          "mode": "id",
          "value": "app216gZPY8ax1Qgd"
        },
        "tableId": {
          "__rl": true,
          "mode": "id",
          "value": "tblaKkOK6RZ4cgXGI"
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerField": "Created",
        "authentication": "airtableOAuth2Api",
        "additionalFields": {}
      },
      "credentials": {
        "airtableOAuth2Api": {
          "id": "qYu4nditWNzeLITf",
          "name": "Airtable account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "faeb9069-2f25-419c-8192-5ed69a49d192",
      "name": "Webhook - Action Task Poor",
      "type": "n8n-nodes-base.webhook",
      "position": [
        180,
        140
      ],
      "webhookId": "4ff46f8a-e1d0-4ad9-8dae-99de53838aaf",
      "parameters": {
        "path": "4ff46f8a-e1d0-4ad9-8dae-99de53838aaf",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 1.1
    },
    {
      "id": "25f65aa6-9d0a-4a32-b2b9-49c2d6fb94cf",
      "name": "Switch1",
      "type": "n8n-nodes-base.switch",
      "position": [
        500,
        140
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Validated",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Webhook - Action Task Poor').item.json.body.actionName }}",
                    "rightValue": "Validate"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Other",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "94250338-cb2a-421c-813b-9d8d5d1e02ed",
                    "operator": {
                      "type": "string",
                      "operation": "notEquals"
                    },
                    "leftValue": "={{ $('Webhook - Action Task Poor').item.json.body.actionName }}",
                    "rightValue": "Validate"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "50909553-8bea-471f-9030-f3d8898abce5",
      "name": "LinkedIn",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        1020,
        680
      ],
      "parameters": {
        "text": "=🌟 Feedback on Our Recent Training Session! 🌟

We are excited to share the positive feedback from our participants regarding our latest training session. Here are some highlights:

Facilitator: {{ $json[\"fields\"][\"Facilitator name\"][0][\"name\"] }}
Course: {{ $json[\"fields\"][\"Course name\"][0] }}

Feedback Details:

Content: {{ $json[\"fields\"][\"Content\"] }}/5
Relevance: {{ $json[\"fields\"][\"Relevant\"] }}/5
Overall Satisfaction: {{ $json[\"fields\"][\"Satisfaction\"] }}/5
Recommendation: {{ $json[\"fields\"][\"Recommend\"] }}/5

A big thank you to {{ $json[\"fields\"][\"Facilitator name\"][0][\"name\"] }} for his excellent work as a facilitator and to all our participants for their valuable feedback. We are committed to continuously improving our training sessions to meet your expectations and needs.

#Training #Feedback #ContinuousLearning #CustomerSatisfaction",
        "postAs": "organization",
        "additionalFields": {}
      },
      "credentials": {
        "linkedInOAuth2Api": {
          "id": "4sXxHri0PRgxO48n",
          "name": "LinkedIn account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b441873f-187c-4777-ab27-d7adf8450d8b",
      "name": "Poor  - Send Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1580,
        320
      ],
      "parameters": {
        "html": "=Dear [Recipient Name],

We would like to inform you that a new task has been created to address the recent training feedback we received. Below are the details of the task:

Task Title: {{ $json[\"title\"] }}

Task Description:
{{ $json[\"description\"] }}

Task Status: {{ $json[\"statusName\"] }}

Instructions:
{{ $json[\"instruction\"] }}

Actions Required:

- {{ $json[\"task\"][\"actions\"][0][\"name\"] }}
Description:
{{ $json[\"task\"][\"actions\"][0][\"description\"] }}

- {{ $json[\"task\"][\"actions\"][1][\"name\"] }}
Description:
{{ $json[\"task\"][\"actions\"][1][\"description\"] }}


Please address this task at your earliest convenience to ensure we promptly respond to the feedback and improve our training program accordingly.

If you have any questions or require further information, please do not hesitate to contact us.

Link : https://demo.usertask.io/app/task/instance/form/{{ $json[\"code\"] }}

Best regards,",
        "options": {},
        "subject": "New Task Created - Urgent: Training Feedback Requires Immediate Attention",
        "toEmail": "contact@usertask.io",
        "fromEmail": "contact@usertask.io"
      },
      "credentials": {
        "smtp": {
          "id": "CnHY3ZPBDwo5EnSH",
          "name": "SMTP account 2"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "0e9c5ee5-416b-4cb3-9797-417003bc74cd",
      "name": "Call Usertask - Create task",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1020,
        60
      ],
      "parameters": {
        "url": "http://demo.usertask.io/api/task/create-instance",
        "method": "POST",
        "options": {},
        "jsonBody": "{
  \"taskCode\": \"tltJf90mJVEnpUZvuQBi\",
  \"callbackUrl\": \"https://n8n-hzd1.onrender.com/webhook/4ff46f8a-e1d0-4ad9-8dae-99de53838aaf\",
  \"description\":\"We have received a training feedback rating of 1 star. It is crucial to address this issue promptly.We recommend scheduling a meeting to discuss the feedback in detail and develop an action plan to improve the training program.\",
  \"instruction\":\"\",
  \"title\":\"Urgent: Training Feedback Requires Immediate Attention\"
}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "X-API-KEY",
              "value": "22d1ce6fa3ae7039fe42d3ddf1ba55d8f5ee9e2c2e6b04788144fca080d1e170"
            },
            {
              "name": "X-CLIENT-ID",
              "value": "f3604b6d2d33af2006ecb0d4910871fa"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "27ab7bd3-e3a8-4d87-b28f-767bff9ec0e1",
      "name": "Call Usertask - Create Task - Pair and good",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1020,
        420
      ],
      "parameters": {
        "url": "http://demo.usertask.io/api/task/create-instance",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "fullResponse": true,
              "responseFormat": "json"
            }
          }
        },
        "jsonBody": "{
  \"taskCode\": \"tltJf90mJVEnpUZvuQBi\",
  \"callbackUrl\": \"https://n8n-hzd1.onrender.com/webhook/4ff46f8a-e1d0-4ad9-8dae-99de53838aaf\",
  \"description\":\"We have received a training feedback rating of 1 star. It is crucial to address this issue promptly.We recommend scheduling a meeting to discuss the feedback in detail and develop an action plan to improve the training program.\",
  \"instruction\":\"\",
  \"title\":\"Urgent: Training Feedback Requires Immediate Attention\"
}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "X-API-KEY",
              "value": "22d1ce6fa3ae7039fe42d3ddf1ba55d8f5ee9e2c2e6b04788144fca080d1e170"
            },
            {
              "name": "X-CLIENT-ID",
              "value": "f3604b6d2d33af2006ecb0d4910871fa"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "ec55cbd8-e863-4dea-b2fc-1834f9d27f13",
      "name": "Send Email after WebHook",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        760,
        -180
      ],
      "parameters": {
        "html": "=Dear Trainer's and HR Manager's,

We have received a training feedback rating of 1 star. It is crucial to address this issue promptly.

Response : {{ $json[\"body\"][\"results\"][0][\"actionName\"] }}

We recommend scheduling a meeting to discuss the feedback in detail and develop an action plan to improve the training program.

Best regards,",
        "options": {},
        "subject": "Urgent: Training Feedback Requires Immediate Attention",
        "toEmail": "contact@usertask.io",
        "fromEmail": "contact@usertask.io"
      },
      "credentials": {
        "smtp": {
          "id": "CnHY3ZPBDwo5EnSH",
          "name": "SMTP account 2"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "bd83083f-e1df-41e8-b7b3-9065fa610ee5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        730.6369999001746,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 714.7562585267917,
        "height": 593.70786516854,
        "content": "## UserTask
**Link** https://demo.usertask.io 

**Login**
contact@usertask.io
**Password**
QSDpo2x10?2020"
      },
      "typeVersion": 1
    },
    {
      "id": "27e89776-7258-44f5-ac8c-5926f38762b7",
      "name": "Call Usertask - Detail Task",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1300,
        320
      ],
      "parameters": {
        "url": "=https://demo.usertask.io/api/task/instance/info/{{ $json[\"body\"][\"code\"] }}",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-API-KEY",
              "value": "22d1ce6fa3ae7039fe42d3ddf1ba55d8f5ee9e2c2e6b04788144fca080d1e170"
            },
            {
              "name": "X-CLIENT-ID",
              "value": "f3604b6d2d33af2006ecb0d4910871fa"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "5576aba7-9051-465f-a095-47a52e35b151",
      "name": "Send Email - Information for marcketing",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1280,
        680
      ],
      "parameters": {
        "options": {},
        "subject": "Task Created",
        "toEmail": "contact@usertask.io",
        "fromEmail": "contact@usertask.io"
      },
      "credentials": {
        "smtp": {
          "id": "CnHY3ZPBDwo5EnSH",
          "name": "SMTP account 2"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "074b8d06-f78a-4209-9172-d8b1a57c97fb",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        540
      ],
      "parameters": {
        "color": 7,
        "width": 373.05722240092274,
        "height": 320.67415730337063,
        "content": "## AirTable 
**For exemple, use** Employee training management **template**. [Guide](https://www.airtable.com/templates/employee-training-management/expnOaGvlQDwuWKVk)

"
      },
      "typeVersion": 1
    },
    {
      "id": "b742a10e-71b2-4022-8c16-53b826512bbe",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 374.83146067415737,
        "height": 303.820224719101,
        "content": "## WebHook 
The webhook allows retrieving the result of a Usertask. Tasks can be completed either via the API or through the Usertask form."
      },
      "typeVersion": 1
    },
    {
      "id": "98cc7ca2-359a-4329-8910-14b6607daa87",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -11.470878578479415,
        -460
      ],
      "parameters": {
        "width": 709.4232592367164,
        "height": 434.93437649014015,
        "content": "## Training Feedback Automation with Usertask and Airtable
This n8n workflow is designed to automate the management of training feedback by integrating Airtable, Usertask, and various notification actions. 

Here is a detailed description of each step in the workflow:

- **Airtable Trigger**: Captures new or updated feedback entries from Airtable.
- **Switch Node**: Evaluates the feedback rating and directs the workflow based on the rating.
- **Webhook**: Retrieves the result of a Usertask task.
- **Task Creation**:
  - Creates tasks in Usertask for poor feedback.
  - Creates follow-up tasks for fair to good feedback.
  - Documents positive feedback and posts recognition on LinkedIn for very good to excellent ratings.
- **Notifications**:
  - Sends email notifications to responsible parties for urgent actions.
  - Sends congratulatory emails and posts on LinkedIn for positive feedback.

Video : [https://youtu.be/U14MhTcpqeY](https://youtu.be/U14MhTcpqeY)
"
      },
      "typeVersion": 1
    },
    {
      "id": "f12d0516-43a2-4517-a633-60d809cd3413",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        460,
        420
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Dissatisfaction",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.fields.Content }}",
                    "rightValue": 1
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Fair",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "2d1c10b8-0418-4dcf-aa53-41f0b75ccc08",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.fields.Content }}",
                    "rightValue": 2
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Good",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d2be2a3f-32ae-4578-a9aa-4a8f2b19f08f",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.fields.Content }}",
                    "rightValue": 3
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Very Good",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "4dd5b796-9180-47d8-9ebd-4164a5dfa0d7",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.fields.Content }}",
                    "rightValue": 4
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Excellent",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "312f4f14-a341-4dea-881c-3c85a9cea13c",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.fields.Content }}",
                    "rightValue": 5
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "6eb8d928-c331-49d5-830a-9442a367254b",
      "name": "Call Usertask - Create Task - Dissatisfaction",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1020,
        240
      ],
      "parameters": {
        "url": "http://demo.usertask.io/api/task/create-instance",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "fullResponse": true,
              "responseFormat": "json"
            }
          }
        },
        "jsonBody": "{
  \"taskCode\": \"tltJf90mJVEnpUZvuQBi\",
  \"callbackUrl\": \"https://n8n-hzd1.onrender.com/webhook/4ff46f8a-e1d0-4ad9-8dae-99de53838aaf\",
  \"description\":\"We have received a training feedback rating of 1 star. It is crucial to address this issue promptly.We recommend scheduling a meeting to discuss the feedback in detail and develop an action plan to improve the training program.\",
  \"instruction\":\"\",
  \"title\":\"Urgent: Training Feedback Requires Immediate Attention\"
}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "X-API-KEY",
              "value": "22d1ce6fa3ae7039fe42d3ddf1ba55d8f5ee9e2c2e6b04788144fca080d1e170"
            },
            {
              "name": "X-CLIENT-ID",
              "value": "f3604b6d2d33af2006ecb0d4910871fa"
            }
          ]
        }
      },
      "typeVersion": 4.1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "955cc31e-3e7b-49b1-85c5-8f4604cbcc9a",
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Call Usertask - Create Task - Dissatisfaction",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Call Usertask - Create Task - Pair and good",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Call Usertask - Create Task - Pair and good",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "LinkedIn",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "LinkedIn",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch1": {
      "main": [
        [
          {
            "node": "Send Email after WebHook",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Call Usertask - Create task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LinkedIn": {
      "main": [
        [
          {
            "node": "Send Email - Information for marcketing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Airtable Trigger": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - Action Task Poor": {
      "main": [
        [
          {
            "node": "Switch1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Usertask - Detail Task": {
      "main": [
        [
          {
            "node": "Poor  - Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Usertask - Create Task - Pair and good": {
      "main": [
        [
          {
            "node": "Call Usertask - Detail Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Usertask - Create Task - Dissatisfaction": {
      "main": [
        [
          {
            "node": "Call Usertask - Detail Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

功能特点

  • 自动检测新邮件
  • AI智能内容分析
  • 自定义分类规则
  • 批量处理能力
  • 详细的处理日志

技术分析

节点类型及作用

  • Airtabletrigger
  • Webhook
  • Switch
  • Linkedin
  • Emailsend

复杂度评估

配置难度:
★★★★☆
维护难度:
★★☆☆☆
扩展性:
★★★★☆

实施指南

前置条件

  • 有效的Gmail账户
  • n8n平台访问权限
  • Google API凭证
  • AI分类服务订阅

配置步骤

  1. 在n8n中导入工作流JSON文件
  2. 配置Gmail节点的认证信息
  3. 设置AI分类器的API密钥
  4. 自定义分类规则和标签映射
  5. 测试工作流执行
  6. 配置定时触发器(可选)

关键参数

参数名称 默认值 说明
maxEmails 50 单次处理的最大邮件数量
confidenceThreshold 0.8 分类置信度阈值
autoLabel true 是否自动添加标签

最佳实践

优化建议

  • 定期更新AI分类模型以提高准确性
  • 根据邮件量调整处理批次大小
  • 设置合理的分类置信度阈值
  • 定期清理过期的分类规则

安全注意事项

  • 妥善保管API密钥和认证信息
  • 限制工作流的访问权限
  • 定期审查处理日志
  • 启用双因素认证保护Gmail账户

性能优化

  • 使用增量处理减少重复工作
  • 缓存频繁访问的数据
  • 并行处理多个邮件分类任务
  • 监控系统资源使用情况

故障排除

常见问题

邮件未被正确分类

检查AI分类器的置信度阈值设置,适当降低阈值或更新训练数据。

Gmail认证失败

确认Google API凭证有效且具有正确的权限范围,重新进行OAuth授权。

调试技巧

  • 启用详细日志记录查看每个步骤的执行情况
  • 使用测试邮件验证分类逻辑
  • 检查网络连接和API服务状态
  • 逐步执行工作流定位问题节点

错误处理

工作流包含以下错误处理机制:

  • 网络超时自动重试(最多3次)
  • API错误记录和告警
  • 处理失败邮件的隔离机制
  • 异常情况下的回滚操作